package com.ruoyi.recycle.utils.kuaidi;


import com.google.gson.Gson;
import com.ruoyi.recycle.utils.kuaidi.core.IBaseClient;
import com.ruoyi.recycle.utils.kuaidi.dto.*;


/***
 * 测试 快递100接口连通性
 */
public class Test {

    public static void main(String[] args) {


        //构建请求快递100接口数据
        String method = "bOrder";
        String key = "KZRcvzwn9348";
        String secret = "a465672f97ff4c1d82bce23ea4c00d42";

        PrintReq printReq = new PrintReq();
        BOrderReq bOrderReq = new BOrderReq();
        bOrderReq.setKuaidicom("jtexpress");
        bOrderReq.setSendManName("张三");
        bOrderReq.setSendManMobile("15966666666");
        bOrderReq.setSendManPrintAddr("广东深圳市南山区金蝶软件园");
        bOrderReq.setRecManName("李四");
        bOrderReq.setRecManMobile("18888888888");
        bOrderReq.setRecManPrintAddr("广东深圳市福田区华强南");
        bOrderReq.setCallBackUrl("http://www.baidu.com");
        bOrderReq.setWeight("1");

        String t = String.valueOf(System.currentTimeMillis());
        String param = new Gson().toJson(bOrderReq);
        System.out.println("param = " + param);
        printReq.setKey(key);
        printReq.setSign(SignUtils.printSign(param, t, key, secret));
        printReq.setT(t);
        printReq.setParam(param);
        printReq.setMethod(ApiInfoConstant.B_ORDER_OFFICIAL_ORDER_METHOD);
        System.out.println(printReq);
        IBaseClient bOrder = new BOrderOfficial();
        try {
            System.out.println(bOrder.execute(printReq));
        }catch (Exception e){

        }
    }


}
